#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
int main()
{
	char str[1000] = { 0 };
	gets_s(str);
	int len = strlen(str);
	int count1 = 0;
	int count2 = 0;
	int count3 = 0;
	int count4 = 0;
	for (int i = 0; i < len; i++)
	{
		if (str[i] > 'A' && str[i] < 'Z'||str[i]>'a'&&str[i]<'z')
		{
			count1++;
		}
		else if (str[i] == ' ')
		{
			count2++;
		}
		else if (str[i] >= '0' && str[i] <= '9')
		{
			count3++;
		}
		else
		{
			count4++;
		}
	}
	printf("%d %d %d %d", count1, count2, count3, count4);
	return 0;
}
